﻿using System;

namespace SPFluid.Core.Extensions
{
    public static class TypeExtensions
    {
        public static Type GetUnderlyingTypeIfNullable(this Type type)
        {
            var underlyingType = Nullable.GetUnderlyingType(type);
            if (underlyingType != null)
            {
                return underlyingType;
            }

            return type;
        }
    }
}